<%
layout("layout.html",{title:'主题', first: '首页', second: '面板', menu: '油卡'}){
%>
<div class="dataTables_wrapper form-inline dt-bootstrap">
    <div class="row">
        <div class="col-xs-12">
            <div class="box">
                <div class="box-header">
                    <h3 class="box-title">全部列表</h3>
                </div>
                <div class="box-body">
                    <table class="table">
                        <thead>
                        <tr>
                            <th>id</th>
                            <th>金额</th>
                            <th>卡号</th>
                            <th>持卡人</th>
                            <th>状态</th>
                            <th>时间</th>
                        </tr>
                        </thead>
                        <tbody>
                        <% for (recharge in recharges) { %>
                        <tr id="rechage-${recharge.id}">
                            <td>${recharge.id}</td>
                            <td>${recharge.money / 100}</td>
                            <td>${recharge.card.number}</td>
                            <td>${recharge.card.username}</td>
                            <td>
                                <% switch (recharge.status) {
                                case 'Success': print('成功');break;
                                case 'Fail': print('失败');break;
                                case 'Submit': print('未处理');break;
                                }
                                %>
                            </td>
                            <td>${recharge.createTime,dateFormat="yy-MM-dd HH:mm"}</td>
                        </tr>
                        <% } %>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-5">
            <div class="dataTables_info" id="example2_info" role="status" aria-live="polite">第${paging.page}页 共${paging.all}页 ${paging.count}条数据
            </div>
        </div>
        <div class="col-sm-7">
            <div class="dataTables_paginate paging_simple_numbers">
                <ul class="pagination">
                    <li class="paginate_button previous <% if (paging.page == 1) print('disabled'); %>">
                        <a href="${ctxPath}/admin/allRecharge?page=${paging.page - 1}" aria-controls="example2" data-dt-idx="0" tabindex="0">上一页</a>
                    </li>
                    <% for (thisPage in paging.shows) { %>
                    <li class="paginate_button <% if (thisPage == paging.page) print('active'); %>"><a href="${ctxPath}/admin/allRecharge?page=${thisPage}" aria-controls="example2" data-dt-idx="1" tabindex="0">${thisPage}</a></li>
                    <% } %>
                    <li class="paginate_button next <% if (paging.page == paging.all) print('disabled'); %>" id="example2_next">
                        <a href="${ctxPath}/admin/allRecharge?page=${paging.page + 1}" aria-controls="example2" data-dt-idx="7" tabindex="0">下一页</a></li>
                </ul>
            </div>
        </div>
    </div>
</div>
<script>
    $(document).ready(function(){
        $('li.disabled a').attr('href', 'javascript:');
    });
</script>
<% } %>